<!--
 * @Author: lirl
 * @Date: 2024-08-10 19:37:29
 * @Description: 部门知悉查看页面
-->
<template>
  <biz-dept-know-view
    :piid="piid"
    :processDefinitionKey="processDefinitionKey"
    :getBizDataFn="getBizDataFn"
    :operateButtonAttrs="operateButtonAttrs"
    :prodDisplayWatermark="prodDisplayWatermark"
    :downloadTitleWordLength="downloadTitleWordLength"
    :enableDbClickPreview="enableDbClickPreview"
    :attachmentSpaceCode="attachmentSpaceCode"
    :attachmentTitle="attachmentTitle"
    :overwriteInnerEventsBtns="overwriteInnerEventsBtns"
    :sendRecordConvertFn="sendRecordConvertFn"
    :bizProcessTemplateAttrs="bizProcessTemplateAttrs"
    @doAction="doAction"
  ></biz-dept-know-view>
</template>

<script>
import CommonService from '@/api/domains/common/CommonService';
import settings from '@/settings/settings';

export default {
  name: 'DepartmentAwarenessPage',
  data() {
    const { $route: { query } } = this;
    return {
      // 流程实例id
      piid: query.piid,
      // 流程模板id
      processDefinitionKey: query.processDefinitionKey,
      // 查询业务数据的方法
      getBizDataFn: (piid) => new CommonService().getFormCommonInfo(piid),
      // 按钮配置
      operateButtonAttrs: settings.templateAttrs.operateButtonAttrs,
      // 在生产环境不跟据密级来控制水印，总是显示水印
      prodDisplayWatermark: false,
      // 一键下载附件截取的字数
      downloadTitleWordLength: 110,
      // 开启双击预览
      enableDbClickPreview: true,
      // 附件域编码
      attachmentSpaceCode: 'default',
      // 附件域的标题
      attachmentTitle: '公文附件',
      // 发送跟踪记录数据转换方式
      sendRecordConvertFn: null,
      // 流程模板属性
      bizProcessTemplateAttrs: settings.templateAttrs,
    };
  },
  computed: {
    // 覆盖组件内部的按钮编码
    overwriteInnerEventsBtns() {
      return [];
    }
  },
  methods: {
    /**
     * 点击顶部按钮事件
     * @param {Object} button 点击的按钮
     */
    doAction(button, fileList) {
      this[button.event]?.(button, fileList);
    },
  }
};
</script>
